home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / patches / pgs3f.lha / 3.0fUpdate / PostScript.LHA / PostScript.ehandler next >
Text File  |  1995-02-06  |  3KB  |  80 lines

  1. %!
  2. % lib/ehandler.ps -- Downloaded Error Break-page handler
  3. % Copyright (c) 1984, 1985, 1986 Adobe Systems Incorporated. 
  4. % All Rights Reserved.
  5. % RCSID: $Header: ehandler.ps,v 2.1 85/11/24 12:20:03 shore Rel $
  6. % ed for class use, mjf, Mon Nov 24 09:26:51 1986
  7.  
  8. % Change or remove this section to use ehandler.ps on a job-by-job basis.
  9. /$brkpage 64 dict def $brkpage begin
  10. /prnt
  11.  {dup type/stringtype ne{=string cvs}if dup length 6 mul
  12.   /tx exch def/ty 10 def
  13.   currentpoint/toy exch def/tox exch def 1 setgray newpath
  14.   tox toy 2 sub moveto 0 ty rlineto tx 0 rlineto 0 ty neg rlineto
  15.   closepath fill tox toy moveto 0 setgray show}bind def
  16. /nl{currentpoint exch pop lmargin exch moveto 0 -10 rmoveto}def
  17. /=={/cp 0 def typeprint nl}def
  18. /typeprint{dup type dup currentdict exch known
  19.   {exec}{unknowntype}ifelse}readonly def
  20. /lmargin 72 def
  21. /rmargin 72 def
  22. /tprint
  23.  {dup length cp add rmargin gt{nl/cp 0 def}if
  24.   dup length cp add/cp exch def prnt}readonly def
  25. /cvsprint{=string cvs tprint( )tprint}readonly def
  26. /unknowntype{exch pop cvlit(??)tprint cvsprint}readonly def
  27. /integertype{cvsprint}readonly def
  28. /realtype{cvsprint}readonly def
  29. /booleantype{cvsprint}readonly def
  30. /operatortype{(//)tprint cvsprint}readonly def
  31. /marktype{pop(-mark- )tprint}readonly def
  32. /dicttype{pop(-dictionary- )tprint}readonly def
  33. /nulltype{pop(-null- )tprint}readonly def
  34. /filetype{pop(-filestream- )tprint}readonly def
  35. /savetype{pop(-savelevel- )tprint}readonly def
  36. /fonttype{pop(-fontid- )tprint}readonly def
  37. /nametype{dup xcheck not{(/)tprint}if cvsprint}readonly def
  38. /stringtype
  39.  {dup rcheck{(",BACK,"()tprint tprint(",BACK,"))tprint}{pop(-string- )tprint}ifelse
  40.  }readonly def
  41. /arraytype
  42.  {dup rcheck{dup xcheck
  43.   {({)tprint{typeprint}forall(})tprint}
  44.   {([)tprint{typeprint}forall(])tprint}ifelse}{pop(-array- )tprint}ifelse
  45.  }readonly def
  46. /packedarraytype
  47.  {dup rcheck{dup xcheck
  48.   {({)tprint{typeprint}forall(})tprint}
  49.   {([)tprint{typeprint}forall(])tprint}ifelse}{pop(-packedarray- )tprint}
  50.   ifelse
  51.  }readonly def
  52. /courier/Courier findfont 10 scalefont def
  53. /OLDhandleerror errordict /handleerror get def
  54. end %$brkpage
  55.  
  56. errordict
  57. /handleerror
  58.  {systemdict begin $error begin $brkpage begin 
  59.   %Note -- newerror is created in $error by all default error operators.
  60.   newerror
  61.    {/newerror false store 
  62.     $error /errorname get (ioerror) ne $error /command get (exec) ne or
  63.      {    %the above conditional is to prevent spurious error reports caused
  64.     %by a  minor communication bug in the AppleTalk implementation.
  65.       vmstatus pop pop 0 ne{grestoreall}if initgraphics courier setfont
  66.       lmargin 720 moveto(ERROR: )prnt errorname prnt
  67.       nl(OFFENDING COMMAND: )prnt/command load prnt
  68.       $error/ostack known
  69.         {nl nl(STACK:)prnt nl nl $error/ostack get aload length{==}repeat}if
  70.       systemdict/showpage get exec
  71.       /newerror true store/OLDhandleerror load end end end exec}
  72.      {end end end} ifelse}
  73.    {end end end}
  74.   ifelse}
  75. dup 0 systemdict put    %bind true systemdict value
  76. dup 4 $brkpage put     %bind true $breakpage value
  77. bind readonly         %lock it up
  78. put            %into errordict
  79.  
  80.